#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int fun(int n, int x)
{
	int result = 0;
	x -= 48;
	while (n)
	{
		if(n % 10 != x)
		{
			result *= 10;
			result += n % 10;
		}
		n /= 10;
	}
	return result;
}
int main()
{
	int a, b;
	char x;
	scanf("%d %d %c", &a, &b, &x);
	printf("%d", fun(a,x)*fun(b,x));
	/*scanf("%c", &x);
	printf("%c\n", x);
	a = x;
	printf("%d\n", a);*/
	
	return 0;
}